﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace CPPProject.CPP.Dto
{
    [AutoMapFrom(typeof(CPPContract))]
    public class CPPContractDto : EntityDto<Guid>
    {
        /// <summary>
        /// 所属公司
        /// </summary>
        public long CompanyId { get; set; }
        public virtual CPPCompany TCompany { get; set; }
        /// <summary>
        /// 合同编号
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string ContractNum { get; set; }
        /// <summary>
        /// 业务类型（0期租1次租2贸易）
        /// </summary>
        [Required]
        [MaxLength(2)]
        public string BizType { get; set; }
        /// <summary>
        /// 客户ID
        /// </summary>
        public long CustomerId { get; set; }
        /// <summary>
        /// 客户名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 收货地址
        /// </summary>
        [MaxLength(500)]
        public string Address { get; set; }
        /// <summary>
        /// 结算方式（月结，季度结算，年度结算）
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string PaymentMtd { get; set; }
        /// <summary>
        /// 付款账期
        /// </summary>
        [MaxLength(50)]
        public string PaymentPeriod { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(500)]
        public string Remark { get; set; }
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime StartDate { get; set; }
        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime EndDate { get; set; }
        /// <summary>
        /// 对账单日
        /// </summary>
        public DateTime ReconciliationDate { get; set; }
        /// <summary>
        /// 状态（0未执行1执行中2已关闭）
        /// </summary>
        [MaxLength(10)]
        public string Status { get; set; }
        /// <summary>
        /// 项目路线
        /// </summary>
        [MaxLength(500)]
        public string ProjectName { get; set; }
        /// <summary>
        /// 租赁天数
        /// </summary>
        public int Days { get; set; }
        /// <summary>
        /// 预警天数
        /// </summary>
        public int WarningDays { get; set; }
        public List <CPPContractDetailDto> Dtllist { get; set; }
    }
    public class ContractAndDtlDto
    {
        /// <summary>
        /// 资产名称
        /// </summary>
        [Required]
        [MaxLength(500)]
        public string Name { get; set; }
        /// <summary>
        /// 资产编码
        /// </summary>
        [Required]
        [MaxLength(50)]
        public string PartNum { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Qty { get; set; }
    }
}
